<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Date" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>2350300097 万朗</title>
</head>

<body>

<%
    request.setCharacterEncoding("UTF-8");
    String[] info=new String[4];//分别放姓名、标题、内容、时间
    info[0]=request.getParameter("name");
    info[1]=request.getParameter("title");
    info[2]=request.getParameter("content");
    SimpleDateFormat matter=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    info[3]=matter.format(new Date());

    //List<String[]> li=new ArrayList<String[]>();
    List<String[]> li=(ArrayList<String[]>)application.getAttribute("li");
    if(li==null){
        li=new ArrayList<String[]>();
    }

    li.add(info);
    application.setAttribute("li", li);
%>
<p align="center"><strong><font size="5">留言板信息</font></strong></p>
<form name="form1" method="post" action="">
    <table width="700" border="1" align="center" cellpadding="2" cellspacing="0">
        <tr align="center" valign="middle" bgcolor="#00FFFF">
            <td><strong>留言者姓名</strong></td>
            <td><strong>留言时间</strong></td>
            <td><strong>留言标题</strong></td>
            <td><strong>留言内容</strong></td>
        </tr>

        <%for(String[]s:li){ %>
        <tr>
            <td align="center" valign="middle"><%=s[0] %></td>
            <td align="center" valign="middle"><%=s[1] %></td>
            <td align="center" valign="middle"><%=s[3] %></td>
            <td align="center" valign="middle"><textarea name="textarea" rows="2"
            ><%=s[2] %></textarea></td>
        </tr>
        <%} %>
    </table>
</form>
<p align="center"><a href="index.jsp">返回留言板</a></p>
</body>
</html>